const fs = require('fs');
const path = require('path');
// 1、判断目录是否存在
// 2、判断文件是否存在
function hasFile(file){
    console.log(`file: ${file}`);
    return fs.existsSync(file);
}
let file = path.join(__dirname, '../test.txt');
let result = hasFile(file);
console.log(`result: ${result}`);
console.log(path.resolve('fs','test.txt'))
// resolve、join 的区别